package com.probiz.estore.system.service.impl;

import java.util.List;

import com.probiz.estore.common.model.system.PaymentGateway;
import com.probiz.estore.core.service.impl.GenericManagerImpl;
import com.probiz.estore.system.dao.PaymentGatewayDao;


/**
 * PaymentGateway Business Delegate (Proxy) implementation to handle communication between web and
 * persistence layer. Implementation of PaymentGatewayManager interface.
 * Developer introduced interfaces should be declared here. Won't get overwritten.
 */
public class PaymentGatewayManagerImpl extends GenericManagerImpl<PaymentGateway> implements com.probiz.estore.system.service.PaymentGatewayManager {
	private PaymentGatewayDao paymentGatewayDao = null;
	
	public void setPaymentGatewayDao(PaymentGatewayDao paymentGatewayDao) {
		this.paymentGatewayDao = paymentGatewayDao;
	}


	public List<PaymentGateway> getAllUnAdded() {
		return paymentGatewayDao.getAllByIsAdd(PaymentGateway.UNADDED);
	}
	
	
	/**
	 * update isAdded status by pamentGatewayId
	 * @param paymentGatewayId
	 * @param isAdded
	 */
	public void updateIsAddedStatus(Integer paymentGatewayId, Short isAdded) {
		paymentGatewayDao.updateIsAddedStatus(paymentGatewayId,isAdded);
	}
	
	public PaymentGateway getByPaymentGatewayCode(String paymentGatewayCode) {
        return paymentGatewayDao.getByPaymentGatewayCode(paymentGatewayCode);
    }


	@Override
	protected void initManager() {
		this.dao = paymentGatewayDao;
	}


	@Override
	protected void preDelete(PaymentGateway entity) {
		
	}


	@Override
	protected void preSave(PaymentGateway entity) {
		
	}
	
}
